<%@include file="../taglibs.jsp" %>
<stripes:layout-render name="/layout/baseview.jsp">
    <stripes:layout-component name="head">
        <jsp:element name="meta">
            <jsp:attribute name="name">
                <c:out value="description"/>
            </jsp:attribute>
            <jsp:attribute name="content">
                <fmt:message key="page.registeracc.description"/>
            </jsp:attribute>
        </jsp:element>
        <jsp:element name="meta">
            <jsp:attribute name="name">
                <c:out value="keywords"/>
            </jsp:attribute>
            <jsp:attribute name="content">
                <fmt:message key="page.main.keywords"/>
            </jsp:attribute>
        </jsp:element>
        <title>
            <fmt:message key="page.registervacacc.description"/>
        </title>
        <script type="text/javascript"
                src="${pageContext.request.contextPath}/ajax/prototype.js"></script>
        <script type="text/javascript" xml:space="preserve">
        function invoke(form, event, container) {
            var params = Form.serialize(form, {submit:event});
            new Ajax.Updater(container, 'RegisterVacancyAccount.action?updateCities=', {method:'post', parameters:params});
        }
    </script>
    </stripes:layout-component>
    <stripes:layout-component name="content">
        <stripes:label name="labelRegisterResumeAccount"/>
        <br/>
        <stripes:form action="/account/RegisterVacancyAccount.action">
            <table class="form">
                <stripes:hidden name="account.uuid"/>
                <!--userName -->
                <tr>
                    <td>
                        <stripes:label name="labelUsername"/>
                    </td>
                    <td>
                        <stripes:text name="account.userName"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="account.userName"/>
                        </div>
                    </td>
                </tr>

                <!--password -->
                <tr>
                    <td>
                        <stripes:label name="labelPassword"/>
                    </td>
                    <td>
                        <stripes:password name="account.password"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="account.password"/>
                        </div>
                    </td>
                </tr>

                <!--password reType -->
                <tr>
                    <td>
                        <stripes:label name="labelRePassword"/>
                    </td>
                    <td>
                        <stripes:password name="account.rePassword"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="account.rePassword"/>
                        </div>
                    </td>
                </tr>

                <!--Name -->
                <tr>
                    <td>
                        <stripes:label name="labelName"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.name"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.name"/>
                        </div>
                    </td>
                </tr>

                <!--Description -->

                <tr>
                    <td>
                        <stripes:label name="labelDescription"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.description"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.description"/>
                        </div>
                    </td>
                </tr>
                <!--Professional Area -->
                <tr>
                    <td>
                        <stripes:label name="labelProfessionalArea"/>
                    </td>
                    <td>
                        <stripes:select name="vacancyAccountDetails.fkProfAreaUuid">
                            <stripes:option value="">
                                <fmt:message key="page.createresume.choose"/>
                            </stripes:option>
                            <stripes:options-collection collection="${actionBean.baseService.professionAreas}"
                                                        label="name"
                                                        value="uuid"/>
                        </stripes:select>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.fkProfAreaUuid"/>
                        </div>
                    </td>
                </tr>

                <!-- Region -->
                <tr>
                    <td>
                        <stripes:label name="labelRegion"/>
                    </td>
                    <td>
                        <stripes:select id="region" name="vacancyAccountDetails.fkRegionId" onchange="invoke(this.form, this.name, 'city');">
                            <stripes:option value="">
                                <fmt:message key="page.createresume.choose"/>
                            </stripes:option>
                            <stripes:options-collection collection="${actionBean.baseService.regions}"
                                                        label="name"
                                                        value="id"/>
                        </stripes:select>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.fkRegionId"/>
                        </div>
                    </td>
                </tr>

                <!-- City -->
                <tr id="city">
                    <td>
                        <stripes:label name="labelPlace"/>
                    </td>
                    <td>
                        <stripes:select name="vacancyAccountDetails.fkCityId">
                            <stripes:option value="">
                                <fmt:message key="page.createresume.choose"/>
                            </stripes:option>
                            <stripes:options-collection collection="${actionBean.cities}"
                                                        label="name"
                                                        value="id"/>
                        </stripes:select>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.fkCityId"/>
                        </div>
                    </td>
                </tr>

                <!--Office Address -->

                <tr>
                    <td>
                        <stripes:label name="labelOfficeAddress"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.officeAddress"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.officeAddress"/>
                        </div>
                    </td>
                </tr>

                <!--Contact Person -->

                <tr>
                    <td>
                        <stripes:label name="labelContact"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.contact"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.contact"/>
                        </div>
                    </td>
                </tr>

                <!--Phone -->

                <tr>
                    <td>
                        <stripes:label name="labelPhone"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.phone"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.phone"/>
                        </div>
                    </td>
                </tr>

                <!--Icq -->

                <tr>
                    <td>
                        <stripes:label name="labelICQ"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.icq"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.icq"/>
                        </div>
                    </td>
                </tr>

                <!--Skype -->

                <tr>
                    <td>
                        <stripes:label name="labelSkype"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.skype"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.skype"/>
                        </div>
                    </td>
                </tr>

                <!--Site -->

                <tr>
                    <td>
                        <stripes:label name="labelSite"/>
                    </td>
                    <td>
                        <stripes:text name="vacancyAccountDetails.siteUrl"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="vacancyAccountDetails.siteUrl"/>
                        </div>
                    </td>
                </tr>

                <!--picture -->

                <tr>
                    <td>
                        <stripes:label name="labelPicture"/>
                    </td>
                    <td>
                        <stripes:file name="photo.pictureBean"/>
                    </td>
                    <td>
                        <div class="fielderror">
                            <stripes:errors field="photo.pictureBean"/>
                        </div>
                    </td>
                </tr>
                <stripes:hidden name="account.accountType" value="ROLE_VACANCY" />
            </table>
            <stripes:submit name="registerNewAccount"/>
        </stripes:form>
    </stripes:layout-component>
</stripes:layout-render>